import 'package:flutter/material.dart';
// 弹出对话框
Future<bool> showDeleteConfirmDialog1(BuildContext con,String title,String contenText,String cancleText,String sureText) {
  return showDialog<bool>(
    context: con,
    builder: (context) {
      return AlertDialog(
        title: Text(
          title,
         textAlign: TextAlign.center,
        ),
        content: Text(
          contenText,
          textAlign: TextAlign.center,
        ),
        actions: <Widget>[
          FlatButton(
            child: Text(cancleText),
            onPressed: () => Navigator.of(context).pop(), // 关闭对话框
          ),
          FlatButton(
            child: Text(sureText),
            onPressed: () {
              //关闭对话框并返回true
              Navigator.of(context).pop(true);
            },
          ),
        ],
      );
    },
  );
}


// 弹出对话框 只content
Future<bool> showDialogContent(BuildContext con,String contenText) {
  return showDialog<bool>(
    context: con,
    builder: (context) {
      return AlertDialog(
        content: Column(
                mainAxisSize:MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Text("当前已经是最新版本"),
                  Text(contenText),
                ],
              )
      );
    },
  );
}